<template>
	<view>
		<cu-custom bgColor="bg-gradual-green" :isBack="true">
			<view slot="backText">返回</view>
			<view slot="content">搜索结果</view>
		</cu-custom>
		<view class="cu-bar bg-white">
			<view class="action sub-title">
				<text class="text-xl text-bold text-green">搜索结果</text>
				<text class="bg-green" style="width:4rem"></text>
			</view>
		</view>
		<view class="cu-card article" v-for="(item, index) in activityList" :key="item.id">
			<view class="cu-item shadow" style="border: 2upx solid lightgray;" @click="activityClick(item.id)">
				<view class="title justify-between flex">
					<view class="text-cut">{{item.title}}</view>
					<view class="text-gray text-sm">
						<text class="cuIcon-attentionfill margin-lr-xs text-green"></text>{{item.view}}
						<text class="cuIcon-messagefill margin-lr-xs text-green"></text>{{item.comment}}
						<text class="cuIcon-hotfill margin-lr-xs text-green"></text>{{item.hot}}
					</view>
				</view>
				<view class="content">
					<image :src="url + '/image/' + item.photo" mode="aspectFill">
					</image>
					<view class="desc">
						<view class="text-content">{{item.content}}</view>
						<view>
							<view class="cu-tag bg-red light sm round" style="font-family: 'TsangerYuYangT W03';">
								{{item.time}}
							</view>
							<view class="cu-tag bg-green light sm round" style="font-family: 'TsangerYuYangT W03';">
								{{item.place}}
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="cu-bar bg-white justify-center">
			<view class="action">
				<text class="cuIcon-pullup text-green"></text>
				<text>没有更多了哦</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: this.url,
				activityList: [],
			}
		},
		methods: {

		},
		onLoad(option) {
			uni.request({
				method: 'GET',
				url: this.url + '/home/search',
				data: {
					condition: option.key
				},
				success: (res) => {
					console.log(res)
					if(res.statusCode == 200){
						this.activityList = res.data.records
					}
				}
			})
		}
	}
</script>

<style>

</style>
